import request from '@/utils/request'

// 创建商品规则值(规格)
export function createProductRule(data) {
  return request({
    url: '/store/product-rule/create',
    method: 'post',
    data: data
  })
}

// 更新商品规则值(规格)
export function updateProductRule(data) {
  return request({
    url: '/store/product-rule/update',
    method: 'put',
    data: data
  })
}

// 删除商品规则值(规格)
export function deleteProductRule(id) {
  return request({
    url: '/store/product-rule/delete?id=' + id,
    method: 'delete'
  })
}

// 获得商品规则值(规格)
export function getProductRule(id) {
  return request({
    url: '/store/product-rule/get?id=' + id,
    method: 'get'
  })
}

// 获得商品规则值(规格)分页
export function getProductRulePage(params) {
  return request({
    url: '/store/product-rule/page',
    method: 'get',
    params
  })
}
// 导出商品规则值(规格) Excel
export function exportProductRuleExcel(params) {
  return request({
    url: '/store/product-rule/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}